3.2.48 \(\int \frac {(d+e x)^3 (f+g x+h x^2)}{a+b x+c x^2} \, dx\) [148]

3.2.48.1 Optimal result
3.2.48.2 Mathematica [A] (verified)
3.2.48.3 Rubi [A] (verified)
3.2.48.4 Maple [A] (verified)
3.2.48.5 Fricas [A] (verification not implemented)
3.2.48.6 Sympy [B] (verification not implemented)
3.2.48.7 Maxima [F(-2)]
3.2.48.8 Giac [A] (verification not implemented)
3.2.48.9 Mupad [B] (verification not implemented)

3.2.48.1 Optimal result

Integrand size = 30, antiderivative size = 591 \[ \int \frac {(d+e x)^3 \left (f+g x+h x^2\right )}{a+b x+c x^2} \, dx=-\frac {\left (b^3 e^3 h-c^3 d \left (3 e^2 f+3 d e g+d^2 h\right )-b c e^2 (b e g+3 b d h+2 a e h)+c^2 e \left (a e (e g+3 d h)+b \left (e^2 f+3 d e g+3 d^2 h\right )\right )\right ) x}{c^4}+\frac {e \left (b^2 e^2 h+c^2 \left (e^2 f+3 d e g+3 d^2 h\right )-c e (b e g+3 b d h+a e h)\right ) x^2}{2 c^3}+\frac {e^2 (c e g+3 c d h-b e h) x^3}{3 c^2}+\frac {e^3 h x^4}{4 c}-\frac {\left (2 c^5 d^3 f-b^5 e^3 h+b^3 c e^2 (b e g+3 b d h+5 a e h)-c^4 d \left (b d (3 e f+d g)+2 a \left (3 e^2 f+3 d e g+d^2 h\right )\right )-b c^2 e \left (5 a^2 e^2 h+4 a b e (e g+3 d h)+b^2 \left (e^2 f+3 d e g+3 d^2 h\right )\right )+c^3 \left (2 a^2 e^2 (e g+3 d h)+b^2 d \left (3 e^2 f+3 d e g+d^2 h\right )+3 a b e \left (e^2 f+3 d e g+3 d^2 h\right )\right )\right ) \text {arctanh}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c^5 \sqrt {b^2-4 a c}}+\frac {\left (c^4 d^2 (3 e f+d g)+b^4 e^3 h-b^2 c e^2 (b e g+3 b d h+3 a e h)+c^2 e \left (a^2 e^2 h+2 a b e (e g+3 d h)+b^2 \left (e^2 f+3 d e g+3 d^2 h\right )\right )-c^3 \left (b d \left (3 e^2 f+3 d e g+d^2 h\right )+a e \left (e^2 f+3 d e g+3 d^2 h\right )\right )\right ) \log \left (a+b x+c x^2\right )}{2 c^5} \]

output
-(b^3*e^3*h-c^3*d*(d^2*h+3*d*e*g+3*e^2*f)-b*c*e^2*(2*a*e*h+3*b*d*h+b*e*g)+ 
c^2*e*(a*e*(3*d*h+e*g)+b*(3*d^2*h+3*d*e*g+e^2*f)))*x/c^4+1/2*e*(b^2*e^2*h+ 
c^2*(3*d^2*h+3*d*e*g+e^2*f)-c*e*(a*e*h+3*b*d*h+b*e*g))*x^2/c^3+1/3*e^2*(-b 
*e*h+3*c*d*h+c*e*g)*x^3/c^2+1/4*e^3*h*x^4/c+1/2*(c^4*d^2*(d*g+3*e*f)+b^4*e 
^3*h-b^2*c*e^2*(3*a*e*h+3*b*d*h+b*e*g)+c^2*e*(a^2*e^2*h+2*a*b*e*(3*d*h+e*g 
)+b^2*(3*d^2*h+3*d*e*g+e^2*f))-c^3*(b*d*(d^2*h+3*d*e*g+3*e^2*f)+a*e*(3*d^2 
*h+3*d*e*g+e^2*f)))*ln(c*x^2+b*x+a)/c^5-(2*c^5*d^3*f-b^5*e^3*h+b^3*c*e^2*( 
5*a*e*h+3*b*d*h+b*e*g)-c^4*d*(b*d*(d*g+3*e*f)+2*a*(d^2*h+3*d*e*g+3*e^2*f)) 
-b*c^2*e*(5*a^2*e^2*h+4*a*b*e*(3*d*h+e*g)+b^2*(3*d^2*h+3*d*e*g+e^2*f))+c^3 
*(2*a^2*e^2*(3*d*h+e*g)+b^2*d*(d^2*h+3*d*e*g+3*e^2*f)+3*a*b*e*(3*d^2*h+3*d 
*e*g+e^2*f)))*arctanh((2*c*x+b)/(-4*a*c+b^2)^(1/2))/c^5/(-4*a*c+b^2)^(1/2)
 
3.2.48.2 Mathematica [A] (verified)

Time = 0.32 (sec) , antiderivative size = 585, normalized size of antiderivative = 0.99 \[ \int \frac {(d+e x)^3 \left (f+g x+h x^2\right )}{a+b x+c x^2} \, dx=\frac {12 c \left (-b^3 e^3 h+c^3 d \left (3 e^2 f+3 d e g+d^2 h\right )+b c e^2 (b e g+3 b d h+2 a e h)-c^2 e \left (a e (e g+3 d h)+b \left (e^2 f+3 d e g+3 d^2 h\right )\right )\right ) x+6 c^2 e \left (b^2 e^2 h+c^2 \left (e^2 f+3 d e g+3 d^2 h\right )-c e (b e g+3 b d h+a e h)\right ) x^2+4 c^3 e^2 (c e g+3 c d h-b e h) x^3+3 c^4 e^3 h x^4+\frac {12 \left (2 c^5 d^3 f-b^5 e^3 h+b^3 c e^2 (b e g+3 b d h+5 a e h)-c^4 d \left (b d (3 e f+d g)+2 a \left (3 e^2 f+3 d e g+d^2 h\right )\right )-b c^2 e \left (5 a^2 e^2 h+4 a b e (e g+3 d h)+b^2 \left (e^2 f+3 d e g+3 d^2 h\right )\right )+c^3 \left (2 a^2 e^2 (e g+3 d h)+b^2 d \left (3 e^2 f+3 d e g+d^2 h\right )+3 a b e \left (e^2 f+3 d e g+3 d^2 h\right )\right )\right ) \arctan \left (\frac {b+2 c x}{\sqrt {-b^2+4 a c}}\right )}{\sqrt {-b^2+4 a c}}+6 \left (c^4 d^2 (3 e f+d g)+b^4 e^3 h-b^2 c e^2 (b e g+3 b d h+3 a e h)+c^2 e \left (a^2 e^2 h+2 a b e (e g+3 d h)+b^2 \left (e^2 f+3 d e g+3 d^2 h\right )\right )-c^3 \left (b d \left (3 e^2 f+3 d e g+d^2 h\right )+a e \left (e^2 f+3 d e g+3 d^2 h\right )\right )\right ) \log (a+x (b+c x))}{12 c^5} \]

input
Integrate[((d + e*x)^3*(f + g*x + h*x^2))/(a + b*x + c*x^2),x]
 
output
(12*c*(-(b^3*e^3*h) + c^3*d*(3*e^2*f + 3*d*e*g + d^2*h) + b*c*e^2*(b*e*g + 
 3*b*d*h + 2*a*e*h) - c^2*e*(a*e*(e*g + 3*d*h) + b*(e^2*f + 3*d*e*g + 3*d^ 
2*h)))*x + 6*c^2*e*(b^2*e^2*h + c^2*(e^2*f + 3*d*e*g + 3*d^2*h) - c*e*(b*e 
*g + 3*b*d*h + a*e*h))*x^2 + 4*c^3*e^2*(c*e*g + 3*c*d*h - b*e*h)*x^3 + 3*c 
^4*e^3*h*x^4 + (12*(2*c^5*d^3*f - b^5*e^3*h + b^3*c*e^2*(b*e*g + 3*b*d*h + 
 5*a*e*h) - c^4*d*(b*d*(3*e*f + d*g) + 2*a*(3*e^2*f + 3*d*e*g + d^2*h)) - 
b*c^2*e*(5*a^2*e^2*h + 4*a*b*e*(e*g + 3*d*h) + b^2*(e^2*f + 3*d*e*g + 3*d^ 
2*h)) + c^3*(2*a^2*e^2*(e*g + 3*d*h) + b^2*d*(3*e^2*f + 3*d*e*g + d^2*h) + 
 3*a*b*e*(e^2*f + 3*d*e*g + 3*d^2*h)))*ArcTan[(b + 2*c*x)/Sqrt[-b^2 + 4*a* 
c]])/Sqrt[-b^2 + 4*a*c] + 6*(c^4*d^2*(3*e*f + d*g) + b^4*e^3*h - b^2*c*e^2 
*(b*e*g + 3*b*d*h + 3*a*e*h) + c^2*e*(a^2*e^2*h + 2*a*b*e*(e*g + 3*d*h) + 
b^2*(e^2*f + 3*d*e*g + 3*d^2*h)) - c^3*(b*d*(3*e^2*f + 3*d*e*g + d^2*h) + 
a*e*(e^2*f + 3*d*e*g + 3*d^2*h)))*Log[a + x*(b + c*x)])/(12*c^5)
 
3.2.48.3 Rubi [A] (verified)

Time = 1.32 (sec) , antiderivative size = 591, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {2159, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {(d+e x)^3 \left (f+g x+h x^2\right )}{a+b x+c x^2} \, dx\)

\(\Big \downarrow \) 2159

\(\displaystyle \int \left (\frac {x \left (c^2 e \left (a^2 e^2 h+2 a b e (3 d h+e g)+b^2 \left (3 d^2 h+3 d e g+e^2 f\right )\right )-b^2 c e^2 (3 a e h+3 b d h+b e g)-c^3 \left (a e \left (3 d^2 h+3 d e g+e^2 f\right )+b d \left (d^2 h+3 d e g+3 e^2 f\right )\right )+b^4 e^3 h+c^4 d^2 (d g+3 e f)\right )+a b^3 e^3 h+a c^2 e \left (a e (3 d h+e g)+b \left (3 d^2 h+3 d e g+e^2 f\right )\right )-a b c e^2 (2 a e h+3 b d h+b e g)-a c^3 d \left (d^2 h+3 d e g+3 e^2 f\right )+c^4 d^3 f}{c^4 \left (a+b x+c x^2\right )}-\frac {c^2 e \left (a e (3 d h+e g)+b \left (3 d^2 h+3 d e g+e^2 f\right )\right )-b c e^2 (2 a e h+3 b d h+b e g)+b^3 e^3 h+c^3 (-d) \left (d^2 h+3 d e g+3 e^2 f\right )}{c^4}+\frac {e x \left (-c e (a e h+3 b d h+b e g)+b^2 e^2 h+c^2 \left (3 d^2 h+3 d e g+e^2 f\right )\right )}{c^3}+\frac {e^2 x^2 (-b e h+3 c d h+c e g)}{c^2}+\frac {e^3 h x^3}{c}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {\text {arctanh}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right ) \left (c^3 \left (2 a^2 e^2 (3 d h+e g)+3 a b e \left (3 d^2 h+3 d e g+e^2 f\right )+b^2 d \left (d^2 h+3 d e g+3 e^2 f\right )\right )-b c^2 e \left (5 a^2 e^2 h+4 a b e (3 d h+e g)+b^2 \left (3 d^2 h+3 d e g+e^2 f\right )\right )+b^3 c e^2 (5 a e h+3 b d h+b e g)-c^4 d \left (2 a \left (d^2 h+3 d e g+3 e^2 f\right )+b d (d g+3 e f)\right )+b^5 \left (-e^3\right ) h+2 c^5 d^3 f\right )}{c^5 \sqrt {b^2-4 a c}}+\frac {\log \left (a+b x+c x^2\right ) \left (c^2 e \left (a^2 e^2 h+2 a b e (3 d h+e g)+b^2 \left (3 d^2 h+3 d e g+e^2 f\right )\right )-b^2 c e^2 (3 a e h+3 b d h+b e g)-c^3 \left (a e \left (3 d^2 h+3 d e g+e^2 f\right )+b d \left (d^2 h+3 d e g+3 e^2 f\right )\right )+b^4 e^3 h+c^4 d^2 (d g+3 e f)\right )}{2 c^5}-\frac {x \left (c^2 e \left (a e (3 d h+e g)+b \left (3 d^2 h+3 d e g+e^2 f\right )\right )-b c e^2 (2 a e h+3 b d h+b e g)+b^3 e^3 h+c^3 (-d) \left (d^2 h+3 d e g+3 e^2 f\right )\right )}{c^4}+\frac {e x^2 \left (-c e (a e h+3 b d h+b e g)+b^2 e^2 h+c^2 \left (3 d^2 h+3 d e g+e^2 f\right )\right )}{2 c^3}+\frac {e^2 x^3 (-b e h+3 c d h+c e g)}{3 c^2}+\frac {e^3 h x^4}{4 c}\)

input
Int[((d + e*x)^3*(f + g*x + h*x^2))/(a + b*x + c*x^2),x]
 
output
-(((b^3*e^3*h - c^3*d*(3*e^2*f + 3*d*e*g + d^2*h) - b*c*e^2*(b*e*g + 3*b*d 
*h + 2*a*e*h) + c^2*e*(a*e*(e*g + 3*d*h) + b*(e^2*f + 3*d*e*g + 3*d^2*h))) 
*x)/c^4) + (e*(b^2*e^2*h + c^2*(e^2*f + 3*d*e*g + 3*d^2*h) - c*e*(b*e*g + 
3*b*d*h + a*e*h))*x^2)/(2*c^3) + (e^2*(c*e*g + 3*c*d*h - b*e*h)*x^3)/(3*c^ 
2) + (e^3*h*x^4)/(4*c) - ((2*c^5*d^3*f - b^5*e^3*h + b^3*c*e^2*(b*e*g + 3* 
b*d*h + 5*a*e*h) - c^4*d*(b*d*(3*e*f + d*g) + 2*a*(3*e^2*f + 3*d*e*g + d^2 
*h)) - b*c^2*e*(5*a^2*e^2*h + 4*a*b*e*(e*g + 3*d*h) + b^2*(e^2*f + 3*d*e*g 
 + 3*d^2*h)) + c^3*(2*a^2*e^2*(e*g + 3*d*h) + b^2*d*(3*e^2*f + 3*d*e*g + d 
^2*h) + 3*a*b*e*(e^2*f + 3*d*e*g + 3*d^2*h)))*ArcTanh[(b + 2*c*x)/Sqrt[b^2 
 - 4*a*c]])/(c^5*Sqrt[b^2 - 4*a*c]) + ((c^4*d^2*(3*e*f + d*g) + b^4*e^3*h 
- b^2*c*e^2*(b*e*g + 3*b*d*h + 3*a*e*h) + c^2*e*(a^2*e^2*h + 2*a*b*e*(e*g 
+ 3*d*h) + b^2*(e^2*f + 3*d*e*g + 3*d^2*h)) - c^3*(b*d*(3*e^2*f + 3*d*e*g 
+ d^2*h) + a*e*(e^2*f + 3*d*e*g + 3*d^2*h)))*Log[a + b*x + c*x^2])/(2*c^5)
 

3.2.48.3.1 Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2159
Int[(Pq_)*((d_.) + (e_.)*(x_))^(m_.)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p 
_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*Pq*(a + b*x + c*x^2)^p, x 
], x] /; FreeQ[{a, b, c, d, e, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]
 
3.2.48.4 Maple [A] (verified)

Time = 1.00 (sec) , antiderivative size = 869, normalized size of antiderivative = 1.47

method result size
default \(\frac {\frac {1}{4} h \,e^{3} x^{4} c^{3}-\frac {1}{3} b \,c^{2} e^{3} h \,x^{3}+c^{3} d \,e^{2} h \,x^{3}+\frac {1}{3} g \,e^{3} x^{3} c^{3}-\frac {1}{2} a \,c^{2} e^{3} h \,x^{2}+\frac {1}{2} b^{2} c \,e^{3} h \,x^{2}-\frac {3}{2} b \,c^{2} d \,e^{2} h \,x^{2}-\frac {1}{2} b \,c^{2} e^{3} g \,x^{2}+\frac {3}{2} c^{3} d^{2} e h \,x^{2}+\frac {3}{2} c^{3} d \,e^{2} g \,x^{2}+\frac {1}{2} c^{3} e^{3} f \,x^{2}+2 a b c \,e^{3} h x -3 a \,c^{2} d \,e^{2} h x -a \,c^{2} e^{3} g x -b^{3} e^{3} h x +3 b^{2} c d \,e^{2} h x +b^{2} c \,e^{3} g x -3 b \,c^{2} d^{2} e h x -3 b \,c^{2} d \,e^{2} g x -b \,c^{2} e^{3} f x +c^{3} d^{3} h x +3 c^{3} d^{2} e g x +3 c^{3} d \,e^{2} f x}{c^{4}}+\frac {\frac {\left (a^{2} c^{2} e^{3} h -3 a \,b^{2} c \,e^{3} h +6 a b \,c^{2} d \,e^{2} h +2 a b \,c^{2} e^{3} g -3 a \,c^{3} d^{2} e h -3 a \,c^{3} d \,e^{2} g -a \,c^{3} e^{3} f +b^{4} e^{3} h -3 b^{3} c d \,e^{2} h -b^{3} c \,e^{3} g +3 b^{2} c^{2} d^{2} e h +3 b^{2} c^{2} d \,e^{2} g +b^{2} c^{2} e^{3} f -b \,c^{3} d^{3} h -3 b \,c^{3} d^{2} e g -3 b \,c^{3} d \,e^{2} f +c^{4} d^{3} g +3 c^{4} d^{2} e f \right ) \ln \left (c \,x^{2}+b x +a \right )}{2 c}+\frac {2 \left (-2 a^{2} b c \,e^{3} h +3 a^{2} c^{2} d \,e^{2} h +a^{2} c^{2} e^{3} g +a \,b^{3} e^{3} h -3 a \,b^{2} c d \,e^{2} h -a \,b^{2} c \,e^{3} g +3 a b \,c^{2} d^{2} e h +3 a b \,c^{2} d \,e^{2} g +a b \,c^{2} e^{3} f -a \,c^{3} d^{3} h -3 a \,c^{3} d^{2} e g -3 a \,c^{3} d \,e^{2} f +c^{4} d^{3} f -\frac {\left (a^{2} c^{2} e^{3} h -3 a \,b^{2} c \,e^{3} h +6 a b \,c^{2} d \,e^{2} h +2 a b \,c^{2} e^{3} g -3 a \,c^{3} d^{2} e h -3 a \,c^{3} d \,e^{2} g -a \,c^{3} e^{3} f +b^{4} e^{3} h -3 b^{3} c d \,e^{2} h -b^{3} c \,e^{3} g +3 b^{2} c^{2} d^{2} e h +3 b^{2} c^{2} d \,e^{2} g +b^{2} c^{2} e^{3} f -b \,c^{3} d^{3} h -3 b \,c^{3} d^{2} e g -3 b \,c^{3} d \,e^{2} f +c^{4} d^{3} g +3 c^{4} d^{2} e f \right ) b}{2 c}\right ) \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}}}{c^{4}}\) \(869\)
risch \(\text {Expression too large to display}\) \(65352\)

input
int((e*x+d)^3*(h*x^2+g*x+f)/(c*x^2+b*x+a),x,method=_RETURNVERBOSE)
 
output
1/c^4*(1/4*h*e^3*x^4*c^3-1/3*b*c^2*e^3*h*x^3+c^3*d*e^2*h*x^3+1/3*g*e^3*x^3 
*c^3-1/2*a*c^2*e^3*h*x^2+1/2*b^2*c*e^3*h*x^2-3/2*b*c^2*d*e^2*h*x^2-1/2*b*c 
^2*e^3*g*x^2+3/2*c^3*d^2*e*h*x^2+3/2*c^3*d*e^2*g*x^2+1/2*c^3*e^3*f*x^2+2*a 
*b*c*e^3*h*x-3*a*c^2*d*e^2*h*x-a*c^2*e^3*g*x-b^3*e^3*h*x+3*b^2*c*d*e^2*h*x 
+b^2*c*e^3*g*x-3*b*c^2*d^2*e*h*x-3*b*c^2*d*e^2*g*x-b*c^2*e^3*f*x+c^3*d^3*h 
*x+3*c^3*d^2*e*g*x+3*c^3*d*e^2*f*x)+1/c^4*(1/2*(a^2*c^2*e^3*h-3*a*b^2*c*e^ 
3*h+6*a*b*c^2*d*e^2*h+2*a*b*c^2*e^3*g-3*a*c^3*d^2*e*h-3*a*c^3*d*e^2*g-a*c^ 
3*e^3*f+b^4*e^3*h-3*b^3*c*d*e^2*h-b^3*c*e^3*g+3*b^2*c^2*d^2*e*h+3*b^2*c^2* 
d*e^2*g+b^2*c^2*e^3*f-b*c^3*d^3*h-3*b*c^3*d^2*e*g-3*b*c^3*d*e^2*f+c^4*d^3* 
g+3*c^4*d^2*e*f)/c*ln(c*x^2+b*x+a)+2*(-2*a^2*b*c*e^3*h+3*a^2*c^2*d*e^2*h+a 
^2*c^2*e^3*g+a*b^3*e^3*h-3*a*b^2*c*d*e^2*h-a*b^2*c*e^3*g+3*a*b*c^2*d^2*e*h 
+3*a*b*c^2*d*e^2*g+a*b*c^2*e^3*f-a*c^3*d^3*h-3*a*c^3*d^2*e*g-3*a*c^3*d*e^2 
*f+c^4*d^3*f-1/2*(a^2*c^2*e^3*h-3*a*b^2*c*e^3*h+6*a*b*c^2*d*e^2*h+2*a*b*c^ 
2*e^3*g-3*a*c^3*d^2*e*h-3*a*c^3*d*e^2*g-a*c^3*e^3*f+b^4*e^3*h-3*b^3*c*d*e^ 
2*h-b^3*c*e^3*g+3*b^2*c^2*d^2*e*h+3*b^2*c^2*d*e^2*g+b^2*c^2*e^3*f-b*c^3*d^ 
3*h-3*b*c^3*d^2*e*g-3*b*c^3*d*e^2*f+c^4*d^3*g+3*c^4*d^2*e*f)*b/c)/(4*a*c-b 
^2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2)))
 
3.2.48.5 Fricas [A] (verification not implemented)

Time = 1.00 (sec) , antiderivative size = 2150, normalized size of antiderivative = 3.64 \[ \int \frac {(d+e x)^3 \left (f+g x+h x^2\right )}{a+b x+c x^2} \, dx=\text {Too large to display} \]

input
integrate((e*x+d)^3*(h*x^2+g*x+f)/(c*x^2+b*x+a),x, algorithm="fricas")
 
output
[1/12*(3*(b^2*c^4 - 4*a*c^5)*e^3*h*x^4 + 4*((b^2*c^4 - 4*a*c^5)*e^3*g + (3 
*(b^2*c^4 - 4*a*c^5)*d*e^2 - (b^3*c^3 - 4*a*b*c^4)*e^3)*h)*x^3 + 6*((b^2*c 
^4 - 4*a*c^5)*e^3*f + (3*(b^2*c^4 - 4*a*c^5)*d*e^2 - (b^3*c^3 - 4*a*b*c^4) 
*e^3)*g + (3*(b^2*c^4 - 4*a*c^5)*d^2*e - 3*(b^3*c^3 - 4*a*b*c^4)*d*e^2 + ( 
b^4*c^2 - 5*a*b^2*c^3 + 4*a^2*c^4)*e^3)*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2*b*c^3)*e^3)*g - ((b^3*c^ 
3 - 4*a*b*c^4)*d^3 - 3*(b^4*c^2 - 5*a*b^2*c^3 + 4*a^2*c^4)*d^2*e + 3*(b...
 
3.2.48.6 Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 4972 vs. \(2 (619) = 1238\).

Time = 57.19 (sec) , antiderivative size = 4972, normalized size of antiderivative = 8.41 \[ \int \frac {(d+e x)^3 \left (f+g x+h x^2\right )}{a+b x+c x^2} \, dx=\text {Too large to display} \]

input
integrate((e*x+d)**3*(h*x**2+g*x+f)/(c*x**2+b*x+a),x)
 
output
x**3*(-b*e**3*h/(3*c**2) + d*e**2*h/c + e**3*g/(3*c)) + x**2*(-a*e**3*h/(2 
*c**2) + b**2*e**3*h/(2*c**3) - 3*b*d*e**2*h/(2*c**2) - b*e**3*g/(2*c**2) 
+ 3*d**2*e*h/(2*c) + 3*d*e**2*g/(2*c) + e**3*f/(2*c)) + x*(2*a*b*e**3*h/c* 
*3 - 3*a*d*e**2*h/c**2 - a*e**3*g/c**2 - b**3*e**3*h/c**4 + 3*b**2*d*e**2* 
h/c**3 + b**2*e**3*g/c**3 - 3*b*d**2*e*h/c**2 - 3*b*d*e**2*g/c**2 - b*e**3 
*f/c**2 + d**3*h/c + 3*d**2*e*g/c + 3*d*e**2*f/c) + (-sqrt(-4*a*c + b**2)* 
(5*a**2*b*c**2*e**3*h - 6*a**2*c**3*d*e**2*h - 2*a**2*c**3*e**3*g - 5*a*b* 
*3*c*e**3*h + 12*a*b**2*c**2*d*e**2*h + 4*a*b**2*c**2*e**3*g - 9*a*b*c**3* 
d**2*e*h - 9*a*b*c**3*d*e**2*g - 3*a*b*c**3*e**3*f + 2*a*c**4*d**3*h + 6*a 
*c**4*d**2*e*g + 6*a*c**4*d*e**2*f + b**5*e**3*h - 3*b**4*c*d*e**2*h - b** 
4*c*e**3*g + 3*b**3*c**2*d**2*e*h + 3*b**3*c**2*d*e**2*g + b**3*c**2*e**3* 
f - b**2*c**3*d**3*h - 3*b**2*c**3*d**2*e*g - 3*b**2*c**3*d*e**2*f + b*c** 
4*d**3*g + 3*b*c**4*d**2*e*f - 2*c**5*d**3*f)/(2*c**5*(4*a*c - b**2)) + (a 
**2*c**2*e**3*h - 3*a*b**2*c*e**3*h + 6*a*b*c**2*d*e**2*h + 2*a*b*c**2*e** 
3*g - 3*a*c**3*d**2*e*h - 3*a*c**3*d*e**2*g - a*c**3*e**3*f + b**4*e**3*h 
- 3*b**3*c*d*e**2*h - b**3*c*e**3*g + 3*b**2*c**2*d**2*e*h + 3*b**2*c**2*d 
*e**2*g + b**2*c**2*e**3*f - b*c**3*d**3*h - 3*b*c**3*d**2*e*g - 3*b*c**3* 
d*e**2*f + c**4*d**3*g + 3*c**4*d**2*e*f)/(2*c**5))*log(x + (2*a**3*c**2*e 
**3*h - 4*a**2*b**2*c*e**3*h + 9*a**2*b*c**2*d*e**2*h + 3*a**2*b*c**2*e**3 
*g - 6*a**2*c**3*d**2*e*h - 6*a**2*c**3*d*e**2*g - 2*a**2*c**3*e**3*f +...
 
3.2.48.7 Maxima [F(-2)]

Exception generated. \[ \int \frac {(d+e x)^3 \left (f+g x+h x^2\right )}{a+b x+c x^2} \, dx=\text {Exception raised: ValueError} \]

input
integrate((e*x+d)^3*(h*x^2+g*x+f)/(c*x^2+b*x+a),x, algorithm="maxima")
 
output
Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(4*a*c-b^2>0)', see `assume?` for 
 more deta
 
3.2.48.8 Giac [A] (verification not implemented)

Time = 0.27 (sec) , antiderivative size = 805, normalized size of antiderivative = 1.36 \[ \int \frac {(d+e x)^3 \left (f+g x+h x^2\right )}{a+b x+c x^2} \, dx=\frac {3 \, c^{3} e^{3} h x^{4} + 4 \, c^{3} e^{3} g x^{3} + 12 \, c^{3} d e^{2} h x^{3} - 4 \, b c^{2} e^{3} h x^{3} + 6 \, c^{3} e^{3} f x^{2} + 18 \, c^{3} d e^{2} g x^{2} - 6 \, b c^{2} e^{3} g x^{2} + 18 \, c^{3} d^{2} e h x^{2} - 18 \, b c^{2} d e^{2} h x^{2} + 6 \, b^{2} c e^{3} h x^{2} - 6 \, a c^{2} e^{3} h x^{2} + 36 \, c^{3} d e^{2} f x - 12 \, b c^{2} e^{3} f x + 36 \, c^{3} d^{2} e g x - 36 \, b c^{2} d e^{2} g x + 12 \, b^{2} c e^{3} g x - 12 \, a c^{2} e^{3} g x + 12 \, c^{3} d^{3} h x - 36 \, b c^{2} d^{2} e h x + 36 \, b^{2} c d e^{2} h x - 36 \, a c^{2} d e^{2} h x - 12 \, b^{3} e^{3} h x + 24 \, a b c e^{3} h x}{12 \, c^{4}} + \frac {{\left (3 \, c^{4} d^{2} e f - 3 \, b c^{3} d e^{2} f + b^{2} c^{2} e^{3} f - a c^{3} e^{3} f + c^{4} d^{3} g - 3 \, b c^{3} d^{2} e g + 3 \, b^{2} c^{2} d e^{2} g - 3 \, a c^{3} d e^{2} g - b^{3} c e^{3} g + 2 \, a b c^{2} e^{3} g - b c^{3} d^{3} h + 3 \, b^{2} c^{2} d^{2} e h - 3 \, a c^{3} d^{2} e h - 3 \, b^{3} c d e^{2} h + 6 \, a b c^{2} d e^{2} h + b^{4} e^{3} h - 3 \, a b^{2} c e^{3} h + a^{2} c^{2} e^{3} h\right )} \log \left (c x^{2} + b x + a\right )}{2 \, c^{5}} + \frac {{\left (2 \, c^{5} d^{3} f - 3 \, b c^{4} d^{2} e f + 3 \, b^{2} c^{3} d e^{2} f - 6 \, a c^{4} d e^{2} f - b^{3} c^{2} e^{3} f + 3 \, a b c^{3} e^{3} f - b c^{4} d^{3} g + 3 \, b^{2} c^{3} d^{2} e g - 6 \, a c^{4} d^{2} e g - 3 \, b^{3} c^{2} d e^{2} g + 9 \, a b c^{3} d e^{2} g + b^{4} c e^{3} g - 4 \, a b^{2} c^{2} e^{3} g + 2 \, a^{2} c^{3} e^{3} g + b^{2} c^{3} d^{3} h - 2 \, a c^{4} d^{3} h - 3 \, b^{3} c^{2} d^{2} e h + 9 \, a b c^{3} d^{2} e h + 3 \, b^{4} c d e^{2} h - 12 \, a b^{2} c^{2} d e^{2} h + 6 \, a^{2} c^{3} d e^{2} h - b^{5} e^{3} h + 5 \, a b^{3} c e^{3} h - 5 \, a^{2} b c^{2} e^{3} h\right )} \arctan \left (\frac {2 \, c x + b}{\sqrt {-b^{2} + 4 \, a c}}\right )}{\sqrt {-b^{2} + 4 \, a c} c^{5}} \]

input
integrate((e*x+d)^3*(h*x^2+g*x+f)/(c*x^2+b*x+a),x, algorithm="giac")
 
output
1/12*(3*c^3*e^3*h*x^4 + 4*c^3*e^3*g*x^3 + 12*c^3*d*e^2*h*x^3 - 4*b*c^2*e^3 
*h*x^3 + 6*c^3*e^3*f*x^2 + 18*c^3*d*e^2*g*x^2 - 6*b*c^2*e^3*g*x^2 + 18*c^3 
*d^2*e*h*x^2 - 18*b*c^2*d*e^2*h*x^2 + 6*b^2*c*e^3*h*x^2 - 6*a*c^2*e^3*h*x^ 
2 + 36*c^3*d*e^2*f*x - 12*b*c^2*e^3*f*x + 36*c^3*d^2*e*g*x - 36*b*c^2*d*e^ 
2*g*x + 12*b^2*c*e^3*g*x - 12*a*c^2*e^3*g*x + 12*c^3*d^3*h*x - 36*b*c^2*d^ 
2*e*h*x + 36*b^2*c*d*e^2*h*x - 36*a*c^2*d*e^2*h*x - 12*b^3*e^3*h*x + 24*a* 
b*c*e^3*h*x)/c^4 + 1/2*(3*c^4*d^2*e*f - 3*b*c^3*d*e^2*f + b^2*c^2*e^3*f - 
a*c^3*e^3*f + c^4*d^3*g - 3*b*c^3*d^2*e*g + 3*b^2*c^2*d*e^2*g - 3*a*c^3*d* 
e^2*g - b^3*c*e^3*g + 2*a*b*c^2*e^3*g - b*c^3*d^3*h + 3*b^2*c^2*d^2*e*h - 
3*a*c^3*d^2*e*h - 3*b^3*c*d*e^2*h + 6*a*b*c^2*d*e^2*h + b^4*e^3*h - 3*a*b^ 
2*c*e^3*h + a^2*c^2*e^3*h)*log(c*x^2 + b*x + a)/c^5 + (2*c^5*d^3*f - 3*b*c 
^4*d^2*e*f + 3*b^2*c^3*d*e^2*f - 6*a*c^4*d*e^2*f - b^3*c^2*e^3*f + 3*a*b*c 
^3*e^3*f - b*c^4*d^3*g + 3*b^2*c^3*d^2*e*g - 6*a*c^4*d^2*e*g - 3*b^3*c^2*d 
*e^2*g + 9*a*b*c^3*d*e^2*g + b^4*c*e^3*g - 4*a*b^2*c^2*e^3*g + 2*a^2*c^3*e 
^3*g + b^2*c^3*d^3*h - 2*a*c^4*d^3*h - 3*b^3*c^2*d^2*e*h + 9*a*b*c^3*d^2*e 
*h + 3*b^4*c*d*e^2*h - 12*a*b^2*c^2*d*e^2*h + 6*a^2*c^3*d*e^2*h - b^5*e^3* 
h + 5*a*b^3*c*e^3*h - 5*a^2*b*c^2*e^3*h)*arctan((2*c*x + b)/sqrt(-b^2 + 4* 
a*c))/(sqrt(-b^2 + 4*a*c)*c^5)
 
3.2.48.9 Mupad [B] (verification not implemented)

Time = 15.32 (sec) , antiderivative size = 967, normalized size of antiderivative = 1.64 \[ \int \frac {(d+e x)^3 \left (f+g x+h x^2\right )}{a+b x+c x^2} \, dx=x^3\,\left (\frac {g\,e^3+3\,d\,h\,e^2}{3\,c}-\frac {b\,e^3\,h}{3\,c^2}\right )+x\,\left (\frac {h\,d^3+3\,g\,d^2\,e+3\,f\,d\,e^2}{c}+\frac {b\,\left (\frac {b\,\left (\frac {g\,e^3+3\,d\,h\,e^2}{c}-\frac {b\,e^3\,h}{c^2}\right )}{c}-\frac {3\,h\,d^2\,e+3\,g\,d\,e^2+f\,e^3}{c}+\frac {a\,e^3\,h}{c^2}\right )}{c}-\frac {a\,\left (\frac {g\,e^3+3\,d\,h\,e^2}{c}-\frac {b\,e^3\,h}{c^2}\right )}{c}\right )-x^2\,\left (\frac {b\,\left (\frac {g\,e^3+3\,d\,h\,e^2}{c}-\frac {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